import file from '@system.file';

export default {
    data: {
        listData: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
    },
    onReady: function () {
        const seft = this
        file.list({
            uri: 'internal://app/',
            success: function (data) {
                console.log('-------------------------------------')
                console.log(data.fileList);
//                seft.listData = data.fileList
            },
            fail: function (data, code) {
                console.error('call fail callback fail,1 code: ' + code + ', data: ' + data);
            },
        });
        //        file.writeText({
        //            uri: 'internal://share/test.txt',
        //            text: 'Text that just for test.',
        //            success: function() {
        //                console.log('call writeText success.');
        //            },
        //            fail: function(data, code) {
        //                console.error('call fail callback fail, code: ' + code + ', data: ' + data);
        //            },
        //        });
    }
}
